package com.example.usercenter.exception;

import com.example.usercenter.common.ErrorCode;

public class BussinessException  extends  RuntimeException{

    private  final int  code;

    private  final  String description;


    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }


    public BussinessException(String message,int  code,String description) {
        super(message);
        this.code = code;
        this.description = description;
    }


    public BussinessException(ErrorCode  errorCode) {

        super(errorCode.getMessage());

        this.code = errorCode.getCode();

        this.description = errorCode.getDescription();
    }






}
